UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q25k4RoGAnpmD5vAJaUVIxzy2G0PR8ISoccnyzG4FMQ=' 
WHERE 
  key_id = '82831ba12dae5f3af6196e14bf13752fd725746a80c2cb3d85e3feba3fbd056d' 
  AND (
    token = 'Q25k4RoGAnpmD5vAJaUVIxzy2G0PR8ISoccnyzG4FMQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045