UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '64jPUGYzdKOWasTCJGAqvqBesR7g1d9Z+z/EXjct9rE=' 
WHERE 
  key_id = 'c5912cb81a86113f1f65ed53dd3992bb00a77c7317aa041037c1a46acb826d76' 
  AND (
    token = '64jPUGYzdKOWasTCJGAqvqBesR7g1d9Z+z/EXjct9rE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017