UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/AQXI+2Sd5Kb3/3kR90sUZmSMVKmodJXPPMsyOBvEfA=' 
WHERE 
  key_id = 'c12d73653a91ef681175e73d4055b21ba02622940508d025de8290c87fe7bb27' 
  AND (
    token = '/AQXI+2Sd5Kb3/3kR90sUZmSMVKmodJXPPMsyOBvEfA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00076