UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9cfk9ozBhkTeuSZ1GOVO95sHDKsAg7B8gfEPs/0j62U=' 
WHERE 
  key_id = '1e7228952af154c21c7700f70b180569a40eadc0ada37b8579c82333fe7b9952' 
  AND (
    token = '9cfk9ozBhkTeuSZ1GOVO95sHDKsAg7B8gfEPs/0j62U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057