UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SQmaumbzdPGBHem4h9mYIvLccUAPgG3go/5rPrtBG6o=' 
WHERE 
  key_id = '8ff1f97b6aeff4ea370a89d4d01293f8a9010308bcc5fa61663e9d87b21d5944' 
  AND (
    token = 'SQmaumbzdPGBHem4h9mYIvLccUAPgG3go/5rPrtBG6o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029