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

Query time 0.00027