UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/FRAD0KO2MeLqqGhXw2udJa8GuD42/WQ0uCWDo0KKKs=' 
WHERE 
  key_id = 'cb27e751969e42f7f4ec976b4c7db9120040981c7953acf828a1da32bd21e1e9' 
  AND (
    token = '/FRAD0KO2MeLqqGhXw2udJa8GuD42/WQ0uCWDo0KKKs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018