UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QSybfveql08mgw8a7zRirZr8xzWqDXEcauCHdgtNYsI=' 
WHERE 
  key_id = '9a0719fdaccf471869415038f485bae6ec0e274de99a5d0af9eb7769966651bf' 
  AND (
    token = 'QSybfveql08mgw8a7zRirZr8xzWqDXEcauCHdgtNYsI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057