UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p2OdZBF7BIAtfCQAUWLrMSMNx0sigGnR3ux5CU74BnE=' 
WHERE 
  key_id = '8b8005cc70e634ba9b63f6f9fb70f50f09639a278f6b71522ba26a370374ab41' 
  AND (
    token = 'p2OdZBF7BIAtfCQAUWLrMSMNx0sigGnR3ux5CU74BnE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063