UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mgjhnpDl5P+HFDkpP1NIOg3m/butq4eQQLeKgsu9wm8=' 
WHERE 
  key_id = 'e1c92d6c09c6dd01e1e6b243d4ece0b4817a6af94adcd4d31d00a5e3be362923' 
  AND (
    token = 'mgjhnpDl5P+HFDkpP1NIOg3m/butq4eQQLeKgsu9wm8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020