UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '168YSuu+NdTvTRROG4gNeyOs8phxQ9HW0AoCZiB/XVA=' 
WHERE 
  key_id = 'ba6f4f379f513df699a2274f40028e332d63d370e18f27f0d67c85706bd94448' 
  AND (
    token = '168YSuu+NdTvTRROG4gNeyOs8phxQ9HW0AoCZiB/XVA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029