UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GGQ2p0kiam2P0NB41/YYELtsvCAlHhmaLsaNRnS5w5M=' 
WHERE 
  key_id = '222eb278966a703ef5162506eb00e9dbeb4d7d7486c1e6ff4087af6fa7863f4d' 
  AND (
    token = 'GGQ2p0kiam2P0NB41/YYELtsvCAlHhmaLsaNRnS5w5M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035