UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mqSDqL0sL/t7ZHVpSis0gvZ6BpO8HVFR0zASQSgZ2us=' 
WHERE 
  key_id = '36cfa650487f97c141346727513b353130d1d0c9cb39c6adfe434f4eae93bdca' 
  AND (
    token = 'mqSDqL0sL/t7ZHVpSis0gvZ6BpO8HVFR0zASQSgZ2us=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051