UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bBUZqM/BtD4lfYQzjB+JB+ocGfpxaxBVtZ02QsdeS5o=' 
WHERE 
  key_id = 'c5d0c55d2995c59e15f49d89396285b89aa89cb3d3b06a687659f2605f2d14ed' 
  AND (
    token = 'bBUZqM/BtD4lfYQzjB+JB+ocGfpxaxBVtZ02QsdeS5o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016