UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jqLYJ8JBmcPWK4D7UySQpO+3TY096x8wLyHiLW2JaQU=' 
WHERE 
  key_id = '98692af35d55e5bf878750fec22e0a0cf7b87c1902dcb1998acd23c5954fb7ab' 
  AND (
    token = 'jqLYJ8JBmcPWK4D7UySQpO+3TY096x8wLyHiLW2JaQU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035