UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vx4tFH3HtcyPOz9Yt2HEEAzeEHrlReW2rlzWcquLwUA=' 
WHERE 
  key_id = '919e1ea3a0c50ebf7a6af9d1b3f8e69ea291983bbc8ca2c9a3da9b038cc24798' 
  AND (
    token = 'vx4tFH3HtcyPOz9Yt2HEEAzeEHrlReW2rlzWcquLwUA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020