UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f2K6m6xp+xMen4dDoii6HoRpIiYV4NaghOPhg2NFx1g=' 
WHERE 
  key_id = '08f664c02687a4293bc7ad083a88f14f9fd75dfe41b606cae937aadda2bd74e5' 
  AND (
    token = 'f2K6m6xp+xMen4dDoii6HoRpIiYV4NaghOPhg2NFx1g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020