UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c8A/KB8Q9htYx0NJIDcfI3WBj79u218Xv6RU2GaGBPE=' 
WHERE 
  key_id = 'ecd7eea35d68b4fd61ccaedd92f0ea34d7d06cc969d1f6dcec57896f75f695f4' 
  AND (
    token = 'c8A/KB8Q9htYx0NJIDcfI3WBj79u218Xv6RU2GaGBPE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046