UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T9/lDUjsfBWDzAfuEluwb6z5lVKNFJBMgtOIPXSQUCk=' 
WHERE 
  key_id = '8892a99ef92a564c50cbe6cbdfd8775a38087e170994ae6aef132c49e8f87892' 
  AND (
    token = 'T9/lDUjsfBWDzAfuEluwb6z5lVKNFJBMgtOIPXSQUCk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035