UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MM+a6xqmDDH7YDSh9ian8R9ub+wReWBdao3fIqoR2lM=' 
WHERE 
  key_id = '9f9d533b70ebc5e3a527616da348b41030b08d0ae8df537cab73894028de5c83' 
  AND (
    token = 'MM+a6xqmDDH7YDSh9ian8R9ub+wReWBdao3fIqoR2lM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020