UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QizTvRTMgVlIUtv3cdMC8LSEuHVJJz8o3f0EytXq8H8=' 
WHERE 
  key_id = '373e614702cced401a38be0df5ff35cd536369823d92f830002b1e2500f63177' 
  AND (
    token = 'QizTvRTMgVlIUtv3cdMC8LSEuHVJJz8o3f0EytXq8H8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039