UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9SWs67YuZBkBcSfmU3hL6L6R/HcLGOYruH6tpXLuAPA=' 
WHERE 
  key_id = '8a704ee50ef287f69474d18d82c023bd9faa124eb26015b6d8452457b2ae2edd' 
  AND (
    token = '9SWs67YuZBkBcSfmU3hL6L6R/HcLGOYruH6tpXLuAPA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030