UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nX4GFHad8BdiphbrOvulKA2RzveuCLzhaxck+JCCazA=' 
WHERE 
  key_id = '3db3fdc0652dbcfff086cf9cea2b24fc95c57d3e8a0cdc1a5d5086666a731791' 
  AND (
    token = 'nX4GFHad8BdiphbrOvulKA2RzveuCLzhaxck+JCCazA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029