UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J/n+FLEMnNgdLuJKsuCi3QrUcZllPah7TMb07mcpoAM=' 
WHERE 
  key_id = '64b3ff53cf4f9c77ad0747d29f4d64b249f51d8a1ed12dae154903ba6b0f92ca' 
  AND (
    token = 'J/n+FLEMnNgdLuJKsuCi3QrUcZllPah7TMb07mcpoAM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058