UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GiiuXWR6mheD1bjGUixPkgKEovCRKZ6CD8T+SINnqEc=' 
WHERE 
  key_id = 'a7232208b99542c35f8348e45ede3c1a6691835b345eb007531df2796af32b54' 
  AND (
    token = 'GiiuXWR6mheD1bjGUixPkgKEovCRKZ6CD8T+SINnqEc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028