UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TlFhp5Ur0WAHamsfMLK+tE9CMRmuR4wLPMOd3zLRarM=' 
WHERE 
  key_id = '48ab36700a8b8aac150a292c90b63cd1974194c1e6881e9fb4818fa2a4fb2a9a' 
  AND (
    token = 'TlFhp5Ur0WAHamsfMLK+tE9CMRmuR4wLPMOd3zLRarM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00079