UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h1vXhTtXu1BWfvs/3cgkrCunqJopcZ4YmJZhW8YMJHI=' 
WHERE 
  key_id = '34784fd87914df9464938bc2629eb6b5e9197dc867631e8700b0a820003c9fe3' 
  AND (
    token = 'h1vXhTtXu1BWfvs/3cgkrCunqJopcZ4YmJZhW8YMJHI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014