UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LSkiCEHzhS7Uhopd/qZu7mUMody04qEjJoODWFtDKME=' 
WHERE 
  key_id = '720c4b420804788ea194c805bbe783c23a71a7496b042091fbff1edd2a346d59' 
  AND (
    token = 'LSkiCEHzhS7Uhopd/qZu7mUMody04qEjJoODWFtDKME=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029