UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yZ6V1Mwds1NeOHcFW0sCCQYM6DcrIAFEVej29ILPBDQ=' 
WHERE 
  key_id = '2625d84120a2fdeab689fce29ed465b21e61cfbd7a37264e4b24af03a3e706bb' 
  AND (
    token = 'yZ6V1Mwds1NeOHcFW0sCCQYM6DcrIAFEVej29ILPBDQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028