UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YNOuZG8QC3QL5d1L9wt6GtiSGqi7qTT2zfJwJtVtle0=' 
WHERE 
  key_id = 'da6a7327ad4c17d543025b7ab5c11e2f4c9a133c6ffe5d5e020da125ffdbcf18' 
  AND (
    token = 'YNOuZG8QC3QL5d1L9wt6GtiSGqi7qTT2zfJwJtVtle0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017