UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dxs/WhAx2O2c1bmxCC3mDLp22XYQ093bRolW7cjW4nU=' 
WHERE 
  key_id = '16dcadb409f741c9b9db3330951d5e647134e94f59c69417f81feb6210fb5fc2' 
  AND (
    token = 'Dxs/WhAx2O2c1bmxCC3mDLp22XYQ093bRolW7cjW4nU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037