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

Query time 0.00024