UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fOtr6oEpoRbv4AwSqVq7jMnNswtWAbw5zERlY+fZDbE=' 
WHERE 
  key_id = '263a7a46bdf8bf5bda60d4e5e9f0a6e96e35ae8e4d809154a63befa93b6b0716' 
  AND (
    token = 'fOtr6oEpoRbv4AwSqVq7jMnNswtWAbw5zERlY+fZDbE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014